package com.A21.XMLSerialization; 
 
import java.util.List;

import com.A21.Object.A21OrderHeader;
import com.A21.Object.TrnDetail;
import com.thoughtworks.xstream.XStream; 

public class XmlSerializer {
	
	public static void main(String[] args) 
	{ 
		XmlSerializer xmlTrasformer = new XmlSerializer(); 
	}
	/* Object to Xml*/ 
	public String objectToXml(Object _objObject) 
	{ 
		XStream xstream = new XStream(); 
		xstream.alias("A21OrderHeader", A21OrderHeader.class);
		xstream.alias("TrnDetail", TrnDetail.class);
		xstream.alias("A21OrderHeaders",List.class);
		return xstream.toXML(_objObject); 
	} 
	
	public String objectToXmlDetails(Object _objObject) 
	{ 
		XStream xstream = new XStream(); 
		
		return xstream.toXML(_objObject); 
	} 

}
